package com.example.service.conversation.controller;

import com.example.common.ResponseVO;
import com.example.common.model.SyncReq;
import com.example.service.conversation.model.DeleteConversationReq;
import com.example.service.conversation.model.UpdateConversationReq;
import com.example.service.conversation.service.ConversationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("v1/conversation")
@Api(tags = "会话相关的接口")
public class ConversationController {

    @Autowired
    ConversationService conversationService;

    @PostMapping("/deleteConversation")
    @ApiOperation("进行删除会话")
    public ResponseVO deleteConversation(@RequestBody @Validated DeleteConversationReq req)  {

        return conversationService.deleteConversation(req);
    }

    @PostMapping("/updateConversation")
    @ApiOperation("进行会话的更新")
    public ResponseVO updateConversation(@RequestBody @Validated UpdateConversationReq req)  {
        return conversationService.updateConversation(req);
    }


    @PostMapping("/syncConversationList")
    @ApiOperation("进行会话的增量更新")
    public ResponseVO syncFriendShipList(@RequestBody @Validated SyncReq req)  {
        return conversationService.syncConversationSet(req);
    }






}
